<script type="text/javascript">
$(document).ready(function() {
	$("#btnPostSearch").click(function(){
		$("#post-search").show();
		$("#user-search").hide();
	});
	$("#btnUserSearch").click(function(){
		$("#user-search").show();
		$("#post-search").hide();
	});
});
</script>
<?php 
	$sessLogin = new Zend_Session_Namespace('Login');
	
	$category_mapper = new Application_Model_CategoryMapper();
	$categoryEntries = $category_mapper->findAll();
?>
<div id="netvigation">
	<table id="tblNetvigation">
		<tr>
			<td>
				<div id="logo">
					<a href="/product/findseller"><img src="/images/layout/logo.png"/></a>
				</div>
			</td>
			<td>
				<div id="search-header">
					<div style="float:left;">
						<span id="btnPostSearch" class="hplSearch">帖子搜尋</span>
						<span id="btnUserSearch" class="hplSearch">用戶搜尋</span>
					</div>
					<div style="float:right;">
						<?php
						if ($sessLogin->mbmId != null){ 
						?>
						<form id="frmSearchProduct" method="post" action="/product/prodform">
							<input id="btnSubmit" class="yellow-button" type="submit" style="border: 3px groove rgb(228,177,80)" value="我要出POST"/>
						</form>
						<?php 
						}
						?>
					</div>
				</div>
				<div id="post-search" class="search-engine">
					<form id="frmSearchProduct" method="post" action="/search/product">
						<input id="txtSrhProduct" type="text" name="product" placeholder="輸入產品關鍵字"/>
						<select name="category">
						<option value="">產品分類</option>
						<?php
						for($i = 0;$i < sizeof($categoryEntries); $i++){
							echo "<option value='" . $categoryEntries[$i]->abbrev . "'>" . $categoryEntries[$i]->category . "</option>";
						}
						?>
						</select>
						<select name="country">
							<option value="">產品購買地點</option>
							<?php 
							$country_mapper = new Application_Model_CountryMapper();
							$countryEntries = $country_mapper->findAll();
							for($i = 0;$i < sizeof($countryEntries); $i++){
							?>
							<option value="<?php echo $countryEntries[$i]->abbrev;?>"><?php echo $countryEntries[$i]->country_name;?></option>
							<?php 
							}
							?>
						</select>
						<input type="submit" value="搜尋"/>
					</form>
				</div>
				<div id="user-search" class="search-engine">
					<form id="frmSearchProduct" method="post" action="/search/user">
						<input id="txtSrhUser" type="text" name="user" placeholder="輸入用戶名稱"/>
						<select name="country">
							<option value="">將會前往地方</option>
							<?php 
							$country_mapper = new Application_Model_CountryMapper();
							$countryEntries = $country_mapper->findAll();
							for($i = 0;$i < sizeof($countryEntries); $i++){
							?>
							<option value="<?php echo $countryEntries[$i]->abbrev;?>"><?php echo $countryEntries[$i]->country_name;?></option>
							<?php 
							}
							?>
						</select>
						<input type="submit" value="搜尋"/>
					</form>
				</div>
				<div style="float: left;">
					<span style="color: rgb(225,115,0);">熱門:</span> <a>GUCCI 維他命丸 GIRLS GENERATION IPHONE4S</a>
				</div>
				<div style="float: right; margin-right:8px;">
					<span style="color: rgb(225,115,0);">每日一問:</span> <a>邊度買LEVIS便?</a>
				</div>
			</td>
			<td>
				<div id="tutorial">
					<img src="/images/layout/tutorial.png" width="170px"/>
				</div>
			</td>
		</tr>
	</table>
</div>